#include "calculator.h"
#include <iostream>
#include <string>

int main()
{
   std::ifstream input("in.txt");
   std::ofstream output("out.txt");
   std::string string;
   calc calc_;
   while (getline(input, string))
   {
      try
      {
         output << calc_.calculate(string) << "\n";
      }
      catch(const std::exception)
      {
         output << "<error>\n";
      }
   }
	return 0;
}

